package {{.table.PackageName}}.model;
////

{{range $index, $import := .subImportList}}
import {{$import}};
{{end}}

import java.io.Serializable;
import java.util.Collection;
import com.lesso.basis.BasisModel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
////

/**
* {{.table.SubTable.FunctionName}}对象 {{.table.SubTable.TableName}}
*
* @author {{.table.SubTable.FunctionAuthor}}
* @since {{.table.SubTable.CreateTime}}
*/
@ApiModel("{{.table.SubTable.TableComment}}")
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("{{.table.SubTable.TableName}}")
public class {{.table.SubTable.ClassName}} extends BasisModel<{{.table.SubTable.ClassName}}>{
    private static final long serialVersionUID = 1L;
////
{{range $index, $column := .table.SubTable.Columns}}
    /**
    *  Java类型:{{ $column.JavaType }}
    *  数据库类型:{{ $column.ColumnType }}
    *  注释:{{ $column.ColumnComment }}
    */
    {{if eq $column.JavaType "Long"}}
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    {{else if eq $column.JavaType "Date"}}
    @JsonFormat(pattern = "yyyy-MM-dd")
    {{end}}
    @TableField("{{$column.ColumnName}}")
    @ApiModelProperty(value = "{{$column.ColumnComment}}")
    {{if eq $column.IsPk "1"}}
    @TableId(value = "{{$column.ColumnName}}", type= IdType.AUTO)
    {{end}}
    private {{$column.JavaType}} {{$column.JavaField}};
////
{{end}}


{{range $index, $column := .table.SubTable.Columns}}
    private static final String COL_{{$column.ColumnName| SnakeScreamingCase}} = "{{$column.ColumnName}}";
{{end}}
////
    @Override
    protected Serializable pkVal() {
        return this.{{.table.SubTable.PkColumn.JavaField}};
    }
////
    @Override
    protected Collection<? extends Serializable> pkVals() {
        return null;
    }

}
